$(document).ready(function(){
	
	
	$(".setscore").click(function(){
		
		var relname = $(this).attr("name");
		score = document.getElementById(relname).value;
		var pattern = /^\d{1,2}$/;
		if(score==""){
			alert("函数不能为空");
		}else if(!pattern.test(score)){
			alert("请您输入数字！");
		}else {
		
		$("#content").load("/Test/setscore.action?score="+score+"&relname="+relname);
		}
	});
	
	
	$("#addTable").hide();
	$("#addHomework").click(function(){
		$("#addTable").show("slow");	
	});
	$("#tijiaoHomework").click(function(){
		$("#addTable").hide();
		var courseName = $("#select").val();
		var homeworkName = $("#textfield").val();
		var homeworkContent = $("#textarea").val();
		$("#content").load("/Test/addHomework.action?courseName="+courseName+"&homeworkContent="+homeworkContent+"&homeworkName="+homeworkName);
	});
	
	
	$(".download").click(function(){
		var homePath = $(this).attr("name");
		//alert(homePath);
		$("#content").load("/Test/Dw.action?homePath="+homePath);
	});
});